<?php echo $header; ?>
<div class="breadcrumb">
  <div class="container">
    <h1><?php echo $heading_title; ?></h1>
    <ul>
      <?php foreach ($breadcrumbs as $breadcrumb) { ?>
      <li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
      <?php } ?>
    </ul>
  </div>
</div>
<div class="container">
  <div class="row"><?php echo $column_left; ?>
    <?php if ($column_left && $column_right) { ?>
    <?php $class = 'col-sm-6'; ?>
    <?php } elseif ($column_left || $column_right) { ?>
    <?php $class = 'col-sm-9'; ?>
    <?php } else { ?>
    <?php $class = 'col-sm-12'; ?>
    <?php } ?>
    <div id="content" class="<?php echo $class; ?>"><?php echo $content_top; ?>
      <?php if (!empty($thumb) || !empty($description)) { ?>
      <div class="description-section">
        <?php if ($description) { ?>
        <?php if ($thumb) { ?>
        <img src="<?php echo $thumb; ?>" alt="<?php echo $heading_title; ?>" title="<?php echo $heading_title; ?>" class="thumb img-responsive" />
        <?php } ?>
        <p><?php echo $description; ?></p>
        <?php } ?>
      </div>
      <?php } ?>
      <?php if ($posts): ?>
      <div class="post-section">
        <?php foreach ($posts as $post): ?>
        <h2><a href="<?php echo $post['href']; ?>" title="<?php echo $post['name']; ?>"><?php echo $post['name']; ?></a></h2>
        <div class="row">
          <?php if ($post['thumb'] && $blog_post_image_position == 'left') { ?>
          <div class="col-sm-2">
            <a href="<?php echo $post['href']; ?>" title="<?php echo $post['name']; ?>"><img src="<?php echo $post['thumb']; ?>" alt="<?php echo $post['name']; ?>" title="<?php echo $post['name']; ?>" class="img-responsive" /></a>
          </div>
          <?php } ?>
          <?php if ($post['description']) { ?>
          <div class="col-sm-<?php echo ($post['thumb'] && $blog_post_image_position == 'left') ? '10' : '12'; ?>">
            <p class="info"><i class="fa fa-calendar-check-o" aria-hidden="true"></i> <?php echo $post['date_added']; ?> <?php echo $post['author']; ?>&nbsp;
            <?php if ($post['categories']): ?>
              <?php foreach ($post['categories'] as $category): ?>
              <a href="<?php echo $category['href']; ?>" title="<?php echo $category['name']; ?>"><?php echo $category['name']; ?></a>&nbsp;
              <?php endforeach ?>
            <?php endif ?>
            </p>
            <?php if ($post['thumb'] && $blog_post_image_position == 'top'): ?>
            <div class="thumb"><a href="<?php echo $post['href']; ?>"><img src="<?php echo $post['thumb']; ?>" alt="<?php echo $post['name']; ?>" title="<?php echo $post['name']; ?>" class="img-responsive" /></a></div>
            <?php endif ?>
            <p><?php echo $post['description']; ?></p>
            <a class="btn btn-primary" href="<?php echo $post['href']; ?>" title="<?php echo $post['name']; ?>"><?php echo $button_read_more; ?></a>
          </div>
          <?php } ?>
        </div>
        <hr>
        <?php endforeach ?>
      </div>
      <div class="row">
        <div class="col-sm-6 text-left"><?php echo $pagination; ?></div>
        <div class="col-sm-6 text-right"><?php echo $results; ?></div>
      </div>
      <?php else: ?>
      <p class="empty"><?php echo $text_empty; ?></p>
      <div class="buttons">
        <div class="pull-right"><a href="<?php echo $continue; ?>" class="btn btn-primary"><?php echo $button_continue; ?></a></div>
      </div>
      <?php endif ?>
      <?php echo $content_bottom; ?></div>
    <?php echo $column_right; ?></div>
</div>
<?php echo $footer; ?>
